﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ERP_RORZE_PERMISSION.Base
{
    public class PermissionConstants
    {
        #region Prefix
        public static readonly string Key = "Ktd@";
        public static readonly string PasswordHash = "Ktd@";
        public static readonly string SaltKey = "S@LT&KEY";
        public static readonly string VIKey = "@1B2c3D4e5F6g7H8";
        public static readonly string FileName = "temp.dat";
        public static readonly string ConfigFile = "config.dat";

        #endregion

        #region Functions

        public class Functions
        {

            ///////////////////////////
            /// Quy ước thêm quyền trong bảng 222_Functions
            /// - [FunctionName]: đặt theo định dạng: TenNhomQuyen.TenQuyen (VD: Basic.View)
            /// - Trường [FunctionID]: là số nguyên ta tự định nghĩa tương ứng với TenQuyen (VD: 1000)
            /// - Lưu ý: FunctionID không được trùng
            //////////////////////////
            /// Cách ẩn hiện các link, button theo quyền:
            /// - Demo: Phương thức ShowHideLink() trong MainForm 
            ///////////////////////////
            /// Quy ước đặt tiền tố cho function
            /// - Basic: 100
            /// - Các thẻ Tab: 200
            /// - Tab General: 222
            /// - Tab Business: 241
            /// - Tab Assembly & Material : 231
            /// - Tab Product: 242
            /// - Tab ToolCutting: 333
            //////////////////////////

            //System function constants 
            public class SystemAdmin
            {
                //Basic prefix: 900
                public const int Users = 9000;
                public const int UserGroups = 9001;
                public const int Functions = 9002;
                public const int Permission = 9003;
                public const int BackUpDB = 9004;
                public const int RestoreDB = 9005;
            }

            //Basic function constants 
            public class Basic
            {
                //Basic prefix: 100
                public const int View = 1000;
                public const int AddNew = 1001;
                public const int Edit = 1002;
                public const int Delete = 1003;
            }
            

            //Tab function constants 
            public class Tab
            {
                //Tab prefix: 200
                public const int System = 2001;
                public const int Business = 2002;
                public const int Product = 2003;
                public const int Assembly = 2004;
                public const int ToolCutting = 2005;
                public const int F2Order = 2006;
            }
            

            //Product function constants 
            public class Product
            {
                //Product prefix: 242
                //PartData
                public const int PartMaterial = 2420;
                public const int OptionData = 2421;
                public const int MaterialList = 2422;
                public const int PartList = 2423;
                public const int Customer = 2424;
                public const int OverTime = 2425;
                //Machine
                public const int MachineList = 2426;
                public const int MachineGroup = 2427;
                public const int MachineDailyTime = 2428;
                //BusOder
                public const int BusOderList = 2429;
                //MO
                public const int MOList = 24210;
                public const int MOMaterial = 24211;
                public const int MOOption = 24212;
                public const int MOActualPrice = 24213;
                public const int MONGCheckDetail = 24214;
                public const int MOQtySatus = 24215;
                public const int MOOptionStatus = 24216;
                public const int InLenh = 24217;
                //PartHanding
                public const int Machine_Hand = 24218;
                public const int Insp_Hand_Return = 24219;
                public const int Hand_Insp_Return = 24220;
                public const int Hand_Insp = 24221;
                public const int Bus_Insp = 24222;
                public const int Insp_Bus_Return = 24223;
                public const int Bus_Insp_Return = 24224;
                public const int Insp_Anod = 24225;
                public const int Anod_Qty_Change = 24226;
                public const int Anod_Insp = 24227;
                public const int Insp_F3 = 24228;
                public const int F3_Store = 24229;
                //DeadLine
                public const int Deadline_Confirm = 24230;
                public const int Deadline_Caculation = 24231;
                //Monthly Charge
                public const int Monthly_Expence = 24232;
                public const int Monthly_Charge_Update = 24233;
                //Quotation
                public const int QuotationList = 24234;
                public const int QuotationMachine = 24235;
                public const int QuotationMaterial = 24236;
                public const int QuotationCaculation = 24237;
                public const int QuotationView = 24238;
                //WTS
                public const int MachineWTS = 24239;
                public const int LaborWTS = 24240;
                public const int DataTranfer = 24241;
                public const int JigReport = 24242;
                //Report
                public const int F2_WTS_Detail_Report = 24243;
                public const int LinhVCuong = 24244;
                public const int TableImport = 24264;
                public const int BaoCaoKeHoach = 24245;
                public const int NGNoiBo = 24246;
                public const int CheckThoiGianLamViec = 24247;
                public const int TGLamViecThang = 24248;
                //Xử lý bề mặt
                public const int XLBM = 24249;
                public const int KH_HangNgay = 24250;
                public const int HangTon = 24251;
                public const int KH_Tong = 24252;
                public const int MeMa = 24253;
                //In cấu hình
                public const int ConfigureList = 24254;
                public const int KinhDoanhList = 24255;
                public const int RessionList = 24256;
                public const int RequireList = 24257;
                public const int ShapeList = 24258;
                public const int ConfigureData = 24259;
                public const int ListQuery = 24260;
                //Basic list
                public const int Work = 24261;
                public const int Jigs = 24262;
                public const int Expence = 24263;
                public const int Options = 24265;
            }

            //Tool cutting
            public class ToolCutting
            {
                public const int Frequency = 3331;
                public const int Maker = 3332;
                public const int Mistake = 3333;
                public const int ProcessStatus = 3334;
                public const int Rotate = 3335;
                public const int Supplier = 3336;
                public const int ToolGroups = 3337;
                public const int Tools = 3338;
                public const int ToolStatus = 3339;
                public const int Kind = 33310;
                public const int Rate = 33311;
            }

            //BasicList function constants 
            public class General
            {
                //....add with prefix: 222
                public const int Country = 22201;
                public const int Group = 22202;
                public const int Staff = 22203;
                public const int Maker = 22204;
                public const int Supplier = 22205;
                public const int Part = 22206;
                public const int UnitExchange = 22207;
                public const int PartClass = 22208;
                public const int Unit = 22209;
                public const int ShipTo = 22210;
                public const int Fuctions = 22211;
                public const int Permission = 22212;
                public const int Users = 22213;
                public const int UserGroups = 22214;

                public const int BankAccount = 22215;
                public const int Currency = 22216;
                public const int ExchangeRate = 22217;
                public const int Customer = 22218;
                public const int Payment = 22219;
                public const int Comp = 22220;
                public const int Kosei = 22221;
                public const int IQ = 22222;
                public const int DeliveryTerm = 22223;
                public const int Transport = 22224;
                public const int Section = 22225;

                public const int Log = 22226;
            }

            //Business function constants 
            public class Business
            {
                //....add with prefix: 241
                public const int ImportQuotation = 24101;
                public const int ExportQuotation = 24102;
                public const int ExportRobotQuotation = 24103;
                public const int ExportPartQuotation = 24104;

                public const int Clearance = 24105;
                public const int Clearance_Order = 24106;
                public const int PurchaseOrder = 24107;
                public const int PurchaseInformation = 24108;
                public const int MasterPO = 24109;
                public const int MasterPODetails = 24110;
                public const int PartReceive = 24111;
                public const int PartMistake = 24112;
                public const int StoreInputEstimate = 24113;

                public const int ExportPlan = 24114;
                public const int IQLastRemain = 24115;
                public const int RZCode = 24116;
                public const int RZConsumption = 24117;
                public const int ConsumptionExportCheck = 24118;
                public const int IQRealTime = 24119;

                public const int Forecast = 24120;

                public const int POReport = 24121;
                public const int MasterPOReport = 24122;
            }

            //Assembly function constants 
            public class Assembly
            {
                //....add with prefix: 231
                public const int F5ControlPlanning = 23101;
                public const int F5ControlWTS = 23102;
                public const int F5Search = 23103;
                public const int F5LocalError = 23104;
                public const int F5ExportError = 23105;

                public const int F4Comp = 23106;
                public const int F4SerialInput = 23107;
                public const int F4AssemblyPlanning = 23108;
                public const int F4AssemblyWTS = 23109;
                public const int F4AssemblyExport = 23110;
                public const int F4Search = 23111;
                public const int F4AssemblyPrint = 23112;
                public const int F4AssemblyCheck = 23113;
                public const int F4LocalError = 23114;
                public const int F4ExportError = 23115;

                public const int MaterialCalculation = 23116;
                public const int MaterialOrder = 23117;
                public const int MaterialImport = 23118;
                public const int MaterialExport = 23119;

                public const int MaterialKosei = 23122;
                public const int MaterialImportPlan = 23123;
                public const int MaterialExportPlan = 23124;

                public const int F5Yoyaku = 23120;

                public const int AssemblyReport = 23121;                 
            }            
        }

        #endregion

        #region Form Title
        public class Form
        {
            public class MessageBox
            {
                public const string Error = "Error";
                public const string Warning = "Warning";
                public const string Notice = "Notice";
                public const string Message = "Message";
                public const string Confirmation = "Confirmation";
            }
        }
        #endregion

        #region Form Message
        public class Message
        {
            public const string AddSuccess = "Data added Successfully";
            public const string AddSuccessAndQuestion = "Data added succesfully. Do you want to continue adding data?";
            public const string UpdateSuccessAndQuestion = "Data updated succesfully. Do you want to update again?";
            public const string AddFailed = "An error occurred while inserting the record to database. Please try again.";
            public const string UpdateSuccess = "Update Successfully";
            public const string UpdateFailed = "An error occurred while updating the record to database. Please try again.";
            public const string DeleteQuestion = "Do you want to permanently delete this item(s)?";
            public const string DeleteFailed = "Error occurred when deleting data. Please try again.";
            public const string LoadFailed = "Error occurred when loading data. Please try again later.";
            public const string FormAlreadyOpened = "This form is already opened.";
            public const string TableIsNull = "No data to edit/delete.";
            public const string QuestionUpdateTool = "Are you sure you want to replace the data from {0} into {1}?";
            public const string NoDataToExport = "No data to export.";
            public const string ErrorToExport = "cannot export.";
            public const string ImportSuccessfully = "Import {0} row(s) successfully. Do you want to refresh data now?";
            public const string ImportSuccessfullyLog = "Table [333_Import]: Import {0} row(s) successfully.";
            public const string ImportFailedLog = "Table [333_Import]: Import data failed.\n Message: {0}";
            public const string QuestionOpenFileExport = "Do you want to open the file?";

        }
        #endregion

        #region Configuration
        public class Configuration
        {
            public class FilterFile
            {
                public const string Excel = "Excel 2007-2013|*.xlsx|Excel 97-2003 (*.xls)|*.xls";
            }
           

        }
        #endregion
    }
}
